<template>
    <div>
        <h1>交互式提示框</h1>
        <button @click="isCool">我是否很帅</button>
        <button @click="OpenConfirm">操作确认提示框</button>
        <button @click="openPrompt">输入确认框</button>
    </div>
</template>

<script>
export default {
    data(){
        return {
            cool:true
        }
    },
    methods:{
        isCool(){
            this.$messagebox({
                title:"帅不帅",
                message:"波哥帅不帅",
                showConfirmButton:true,
                showCancelButton:true
            });
        },
        OpenConfirm(){
            this.$messagebox.confirm("是否执行该操作").then(action => {
                console.log(action);
                console.log(1)
            }).catch(err => {
                console.log(err);
            });
            console.log(3);
        },
        openPrompt(){
            this.$messagebox.prompt("波哥帅不帅？").then(({value,action}) => {
                console.log(value);
            }).catch(err=>{});
        }
    }
}
</script>

<style>

</style>